%!PS

% This code copyright 1999, Alan Jackson, alan@ajackson.org and is
% protected under the Open Source license. Code may be copied and
% modified so long as attribution to the original author is
% maintained.

% fields to replace are xcenter, ycenter (center of page in points)
% inc (either 0.1 inch or 0.1 cm in units of points)
% numx and numy : number of time to loop for x and y axes
% and pagesize

%	set the pagesize in points here
<< /PageSize [612 792]>> setpagedevice
gsave


/fontsize 15 def
/Helvetica findfont fontsize scalefont setfont

%	draw x and y rules for calibration
%   ycenter will be 5.5*72 for Letter paper (8.5x11)
%	inc will be 7.2 for units = english, and 2.83465 for units = metric
/makerule { 0 396 moveto % left edge, center page
            /label (1) def
			/indx 0 def
            1 1 22 {
				1 1 4 {
					pop % clear index from stack
					2.8346457 0 rlineto
					0 4 rlineto
					0 -4 rmoveto
				} for
				2.8346457 0 rlineto
				0 6 rlineto
				0 -6 rmoveto
				1 1 4 {
					pop % clear index from stack
					2.8346457 0 rlineto
					0 4 rlineto
					0 -4 rmoveto
				} for
				2.8346457 0 rlineto
				0 8 rlineto
				0 4 rmoveto
				label show
				label stringwidth pop -1 mul 0 rmoveto
				/indx indx 1 add def % increment indx
				/label indx 1 add 3 string cvs def % increment label
				0 -21 rlineto
				0 9 rmoveto
			} for
            306 0 moveto % bottom edge, center page
            /label (1) def
			/indx 0 def
			1 1 28 {
				1 1 4 { % minor ticks
					pop % clear index from stack
					0 2.8346457 rlineto
					4 0 rlineto
					-4 0 rmoveto
				} for
				0 2.8346457 rlineto
				6 0 rlineto
				-6 0 rmoveto
				1 1 4 {
					pop % clear index from stack
					0 2.8346457 rlineto
					4 0 rlineto
					-4 0 rmoveto
				} for
				0 2.8346457 rlineto
				8 0 rlineto
				4 0 rmoveto
				label show
				label stringwidth pop -1 mul 0 rmoveto
				/indx indx 1 add def % increment indx
				/label indx 1 add 3 string cvs def % increment label
				-20 0 rlineto
				8 0 rmoveto
			} for
			stroke
          } def

makerule % calibrate
		  
showpage
grestore
%------------- end of Calibrate definition
